<template>
    <div>
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
            :current-page="localCurrentPage" :page-sizes="[10, 20, 50, 100]" :page-size="localPageSize"
            layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
    </div>
</template>

<script>
export default {
    props: ['currentPage', 'pageSize', 'total'],

    data() {
        return {
            localCurrentPage: this.currentPage,
            localPageSize: this.pageSize,
            localTotal: this.total,
        }
    },
    methods: {
        //分页查询相关方法
        handleSizeChange(val) {
            this.localPageSize = val; // 改变每页显示的条数
            this.localCurrentPage = 1; // 重置当前页为第一页
            this.$emit('newValue', this.localPageSize, this.localCurrentPage);
        },
        handleCurrentChange(val) {
            this.localCurrentPage = val; // 改变当前页码
            this.$emit('newCurrentPage', this.localCurrentPage);
            // this.$parent.getPmjlList(val);
        }
    }
}
</script>


<style scoped lang="less"></style>
